﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="AC001_Query.aspx.cs" Inherits="View_MIS_AC001_Query" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script type="text/javascript">
    
        function Button1_onclick(AgrNo) {
            //alert("hello");
            //alert(hdn_accno.value);
            //window.opener.document.getElementById(hdn_accno.value).value = AgrNo;
            //window.close();
            //alert(document.getElementById("hdn_return").value);
            window.opener.document.getElementById(document.getElementById("hdn_return").value).value = AgrNo;
        }
        /*
        function SetTextValue(Agrs) {
        alert(Agrs);
        document.getElementById("hdn_return").value = Agrs;
        }
        */
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <asp:HiddenField ID="hdn_return" runat="server" />
    <div>
        <fieldset>
            <legend><label>科目查詢</label></legend>
            <div>
                <div>
                    <label>科目：</label>
                    <asp:TextBox ID="txtAccNo" runat="server" ></asp:TextBox>                    
                </div>
                <div>
                    <label>名稱：</label>
                    <asp:TextBox ID="txtAccName" runat="server"></asp:TextBox>
                </div>
                <div>
                    <asp:Button ID="btnQuery" runat="server" OnClick="btnQuery_Click" 
                        Text = "查詢"
                    />
                </div>
            </div>
        </fieldset>
    </div>
    <asp:GridView ID="gv1" runat="server" AutoGenerateColumns="false" 
        PageSize="50"
        AllowPaging="true"
        OnRowDataBound = "gv1_RowDataBound" 
        OnPageIndexChanging="gv1_PageIndexChanging"
        >
        <Columns>
            <asp:TemplateField >
                <ItemTemplate>
                    <asp:Button ID="btnSel" runat="server" Text="選擇" />
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="acc_no" HeaderText="科目" />
            <asp:BoundField DataField="acc_name" HeaderText="名稱" />
        </Columns>
    </asp:GridView>
    </form>
</body>
</html>
